<me:UIABAUFM  x:Class="WPFExcelReport.TFAB50"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls" 
    xmlns:Localization="clr-namespace:Localization;assembly=Localization" 
    xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls"  
     xmlns:me="clr-namespace:WPFExcelReport"  
    x:Name="TV"
    Loaded="Window_Loaded"
 >
    <me:UIABAUFM.Resources>
        <CollectionViewSource   x:Key="vwMaster" />
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:PNumConverter x:Key="pnum"/>
        <ucd:TextTrimmingConverter  x:Key="trim"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
    </me:UIABAUFM.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="1*" />
        </Grid.RowDefinitions>
        <StackPanel   Grid.Column="0">
            <WrapPanel>
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock  Grid.Column="0" Height="Auto"   Width="Auto"  Margin="20,0,0,0" Text="{Binding Source={Localization:Translate Word=盘号:}}"  VerticalAlignment="Center" />
                    <TextBlock  Grid.Column="1"   Background="LightCyan"  FontSize="18" Height="Auto"    Width="60"     Margin="15,0,0,0"  
                                   Text="{Binding Path=ABAAPOS, Source={StaticResource ResourceKey=vwMaster}}" 
                                   VerticalAlignment="Center"  />
                </Grid>
                <Grid  Margin="20,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock  Grid.Column="0"  Height="Auto"   Width="Auto"  Margin="0,0,0,0" Text="{Binding Source={Localization:Translate Word=盘数}}"  VerticalAlignment="Center"/>
                    <TextBox Grid.Column="1" Background="White"  FontSize="18" Height="Auto"    Width="60" Name="txtBatches"   Margin="15,0,0,0" Text="0"   VerticalAlignment="Center"/>
                </Grid>
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <Button Grid.Column="0" FontSize="18" Width="20" Height="20" Margin="0,0,0,0"  Name="btnSaveBatch" Click="btnSaveBatch_Click">
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/save.png" />
                        </Button.Background>
                    </Button>
                    <TextBlock Grid.Column="1" Background="White"   Height="Auto"    Width="Auto"   Margin="0,0,0,0" Text="{Binding Source={Localization:Translate Word=分盘}}"   VerticalAlignment="Center"/>
                </Grid> 
            </WrapPanel>
        </StackPanel>
        <DataGrid Grid.Row="1"  Margin="0,0,0,0" 
                              FontSize="12"
                              CanUserReorderColumns="True"  
                              CanUserResizeRows="True" CanUserSortColumns="True"                  
                              AutoGenerateColumns="False"   
                              EnableRowVirtualization="True"  
                              VerticalScrollBarVisibility="Auto"
                              RowDetailsVisibilityMode="VisibleWhenSelected" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                              IsSynchronizedWithCurrentItem="True" Opacity="10" Visibility="Visible"
                              ItemsSource="{Binding Source={StaticResource ResourceKey=vwMaster}}" 
                  x:Name="dlgMaster" 
                              >
            <DataGrid.Columns>
                <DataGridTextColumn Header="批次" Binding="{Binding ABAAPOS,Converter={StaticResource ResourceKey=pnum}}" Width="Auto"/>
                <DataGridTextColumn Header="" Binding="{Binding ABAAUFKRS}" Width="Auto"/>
                <DataGridTextColumn Header="分盘" Binding="{Binding ABAAUFLFD}" Width="Auto"/>
                <DataGridTextColumn Header="" Binding="{Binding ABAAUFPOS}" Width="Auto"/>
                <DataGridTextColumn Header="纱线" Binding="{Binding ABPART}" Width="Auto"/>
                <DataGridTextColumn Header="色号" Binding="{Binding ABPFARBE,Converter={StaticResource ResourceKey=gb2312}}" Width="Auto"/>
                <DataGridTextColumn Header="盘量" Binding="{Binding ABASSTKGEW,Converter={StaticResource ResourceKey=d1000 }}" Width="Auto"/>
                <DataGridTextColumn Header="盘数" Binding="{Binding ABASANZSTK}" Width="Auto"/>
                <DataGridTextColumn Header="总重" Binding="{Binding ABARESMG,Converter={StaticResource ResourceKey=d1000 }}" Width="Auto"/>
            </DataGrid.Columns>
        </DataGrid  >
    </Grid>
</me:UIABAUFM>
